//
//  GoingProjectTableViewCell.m
//  work
//
//  Created by 徐宏飞 on 16/6/2.
//  Copyright © 2016年 方伟. All rights reserved.
//

#import "GoingProjectTableViewCell.h"
#import "GoingProjectModel.h"


@interface GoingProjectTableViewCell ()

@property (weak, nonatomic) IBOutlet UIButton *lblProjectState;

@property (weak, nonatomic) IBOutlet UILabel *lblStartTime;
@property (weak, nonatomic) IBOutlet UILabel *lblEndTime;
@property (weak, nonatomic) IBOutlet UILabel *lblAdd;

@property (weak, nonatomic) IBOutlet UILabel *lblOwner;
@property (weak, nonatomic) IBOutlet UILabel *lblOwnerTel;

@property (weak, nonatomic) IBOutlet UILabel *lblPrice;
@property (weak, nonatomic) IBOutlet UILabel *lblSquare;
@property (weak, nonatomic) IBOutlet UILabel *lblAmount;

@end



@implementation GoingProjectTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


-(void)setModel:(GoingProjectModel *)model{
    _model = model;
    
    _lblProjectState.enabled = NO;
    switch (_model.task_day_id.intValue) {
            
        case 0:
            [_lblProjectState setTitle:@"填写报告" forState:UIControlStateNormal];
            [_lblProjectState setBackgroundColor:COLOR_THEHE];
            break;
        case 1:
            [_lblProjectState setBackgroundColor:RGBA(233, 147, 67, 1)];
            [_lblProjectState setTitle:@"查看报告" forState:UIControlStateNormal];
            break;
        case 2:
            _lblProjectState.enabled = YES;
            [_lblProjectState setTitle:@"填写报告" forState:UIControlStateNormal];
            [_lblProjectState setBackgroundColor:[UIColor lightGrayColor]];
            break;
        default:
            break;
    }
    
    
    _lblStartTime.text = [NSString getBeijingDayWithStrTime:_model.start_day];
    _lblEndTime.text = [NSString getBeijingDayWithStrTime:_model.end_day];
    _lblAdd.text = [NSString stringWithFormat:@"%@", _model.address];
    _lblOwner.text = [NSString stringWithFormat:@"业主:%@", _model.contact_name];
    _lblOwnerTel.text = [NSString stringWithFormat:@"联系电话:%@", _model.mobile];
    _lblPrice.text = [NSString stringWithFormat:@"%@元/平方", _model.price];
    _lblSquare.text = [NSString stringWithFormat:@"x%@平方", _model.square];
    _lblAmount.text = [NSString stringWithFormat:@"共计:%@元", _model.amount];
    
    
    
}

@end
